package com.ffcs.ffxtc.modules.base.controller;

import com.ffcs.utils.MinioUtils;
import com.ffcs.utils.base.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author zhangzhengxing
 */
@RestController
@RequestMapping("/minio")
@Tag(name = "文件上传", description = "")
@RequiredArgsConstructor
public class MinioController {

    @PostMapping("/upload")
    @Operation(summary = "查询所有")
    public R<String> findAllDrawdbUser(@RequestParam("file") MultipartFile file) {
        String imgUrl = MinioUtils.uploadFile("http://39.98.125.126:9000", "admin",
                "zx8257686@", "drawdb", file);
        return R.ok(imgUrl);
    }

}
